<%@ page import="com.net.pojo.User" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    Object isValid = request.getSession().getAttribute("userIsValid");
    if (isValid == null || Boolean.valueOf(isValid.toString()) != true) {
        request.getRequestDispatcher("login.html").forward(request, response);
    }
    Object userList = request.getAttribute("userList");
    List<User> users = new ArrayList<User>();
    if (userList != null) {
        users = (List<User>) userList;
    }
%>
<html>
<head>
    <title>Title</title>

</head>
<body>
<div>
    <form id="form1" name="form1" action="/user?type=list" method="post">
        <input type="text" id="keyword" name="keyword">
        <input type="submit" id="submitBtn" name="submitBtn" value="查询"/>
    </form>
</div>
<table>
    <tr>
        <th>用户名</th>
        <th>密码</th>
    </tr>
    <%
        for (User user : users) {

    %>
    <tr>
        <td><%=user.getName()%>
        </td>
        <td><%=user.getPassword()%>
        </td>
    </tr>
    <%
        }
    %>
</table>

</body>
</html>
